

<template>
<h4>用户注册组件</h4>
  用户名:<input type="text" placeholder="请输入你的用户名"  v-model="user.username"><br>
  用户密码：<input type="text" placeholder="请输入你的用户密码" v-model="user.password"><br>
  性别:
  <input type="radio" name="gender" value="1" v-model="user.gender">男
  <input type="radio" name="gender" value="0" v-model="user.gender">女
  <br>
  <button @click="reg">点我注册</button>
</template>

<script setup >

import {ref} from "vue";

const user  = ref({
  username:'',
  password:'',
  gender:''
});
const reg = () => {
  console.log('注册')
  console.log(user.value)
}
</script>

<style scoped>

</style>